//Source file: D:\\test\\com\\ce\\pms\\charge\\model\\TraRtra.java

package com.ce.pms.charge.model;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 *值对象名称:交易关系 关联数据表:FEE_TRA_R_TRA
 * @author Adama Yue
 * @CreateDate:2008-7-11
 */
@Embeddable
public class TraRtra {
	@org.hibernate.annotations.Parent
	private AbstractTrans masterTrans;
	@ManyToOne
	@JoinColumn(name="TRANSACTION_ID2",nullable=false,updatable=false)
	private AbstractTrans relatingTrans;
	/**
	 * 关联关系: 关系类型: 账户内-收费账户-应收交易间 001减免 002调整 003滞纳金 账户内-收费账户-支付交易间 004多重支付
	 * 账户内-收费账户-应收-支付交易间 005支付关系
	 *
	 * 账户间-应收账户-预交款账户 006抵冲关系
	 */
	@Column(name="RELATION_TYPE",length=3)
	private String relatingType;
	/**
	 * @roseuid 48757D1703D8
	 */
	public TraRtra() {}

	public TraRtra(AbstractTrans masterTrans, AbstractTrans relatingTrans, String relatingType) {
		this.masterTrans = masterTrans;
		this.relatingTrans = relatingTrans;
		this.relatingType = relatingType;
	}

	public boolean equals(Object o) {
		if(o != null && o instanceof TraRtra) {
			TraRtra that = (TraRtra)o;
			return this.masterTrans.equals(that.masterTrans) &&
				   this.relatingTrans.equals(that.relatingTrans) &&
				   this.relatingType.equals(that.relatingType);
		} else {
			return false;
		}
	}
	public int hashCode() {
		return masterTrans.hashCode() + relatingTrans.hashCode() + relatingType.hashCode();
	}
	public AbstractTrans getMasterTrans() {
		return masterTrans;
	}

	public void setMasterTrans(AbstractTrans masterTrans) {
		this.masterTrans = masterTrans;
	}

	public AbstractTrans getRelatingTrans() {
		return relatingTrans;
	}

	public void setRelatingTrans(AbstractTrans relatingTrans) {
		this.relatingTrans = relatingTrans;
	}

	public String getRelatingType() {
		return relatingType;
	}

	public void setRelatingType(String relatingType) {
		this.relatingType = relatingType;
	}

}
